<cfoutput>
<script type="text/javascript">
function check(){
 
message=""
 
ok = true;
 
var ll = document.forms[0].thepassword.value;
ll = ll.length;
if (ll < 8) {
   alert("Password too short! Must be 8 characters long");
   return false;
}
 
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms[0].username.value;
 
   // search email text for regular exp matches
    if (strEmail == "" || strEmail == null || !isNaN(strEmail) ||
strEmail.charAt(0) == ' ' || strEmail.search(validRegExp) == -1)
   {
      message="Unfortunately that is not a valid e-mail address\n"
      ok=false;
    }
 
	if (ok) return true;
	else {
		alert(message+"\nPlease amend and retry");
		return false;
	}
 
}

// -->
</script>
 
<body onLoad="document.forms.getname.username.focus()" >
 
<form name="getname" action="reg.cfm" method="post" onsubmit="return check();">




<cfif isDefined("session.message")>
<h1 style="background-color:red;color:white;">#session.message#</h1>
<cfset session.message="">
</cfif>

<cfif not isDefined("session.id")>
    <h1>Your Details</h1>

<cfset chars="23456789ABCDEFGHJKMNPQRS">
<cfset length=randRange(4,7)>
<cfset result="">
<cfset i="">
<cfset char="">

<cfscript>
for (i=1; i<length; i++) {
char=mid(chars,randRange(1,len(chars)),1);
result &=char;
}
</cfscript>

<cfset captcha=result>
<cfset captchaHash = hash(captcha)>
<table border=1 style="border: 3px solid black;">
    <form id="getname" action="/ecada/reg.cfm" method="post" onsubmit="return check();">
<tr><td>
          Your Name:</td><td><input type="text"  name="thename" size="20" /></td></tr>
          <tr><td>
         User Name:</td><td><input type="text"  name="UserNme" id="userNme size="20" /></td></tr>
          <tr><td>Email Address:</td><td><input type="text" name="email" size="20" /></td></tr>
         <tr><td> Password:</td><td><input type="password"  name="thepassword"
    size="20" />
<font color="red">Minimum 8 Characters</font></td></tr>
<tr><td colspan=2 align="center">
<cfimage action="captcha" width="300" height="75" text="#captcha#"><br>
<input type="hidden" name="captchaHash" value="#captchaHash#">
Enter the Text you see in the above box here:<input name="captcha" type="text">
</td></tr>
<tr><td colspan=2 align="center">
    <input align="center" type="submit" value="Click to Create Account"
    style="color: black; font-weight: bold; border: 3px solid
    ##101010; background-color:##00ff00 ; width:350px; height:75px;">
         
    </form>
</td></tr></table>

<cfelse>
<h2>ECADA</h2>
<a href="/ecada/ce.cfm">Create new experiment.</a><br/>

</cfif>

</cfoutput>
